package com.cencat.user.dto;

import jakarta.validation.constraints.*;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;

/**
 * 角色查询DTO
 * @author cencat
 * @since 2024-01-01
 */
@Data
@Schema(description = "角色查询DTO")
public class RoleQueryDTO {

    @Schema(description = "角色名称（模糊查询）", example = "管理员")
    private String roleName;

    @Schema(description = "角色编码", example = "ADMIN")
    private String roleCode;

    @Min(value = 0, message = "角色状态值不正确")
    @Max(value = 1, message = "角色状态值不正确")
    @Schema(description = "角色状态（0-禁用，1-正常）", example = "1")
    private Integer status;

    @Min(value = 1, message = "角色类型值不正确")
    @Max(value = 2, message = "角色类型值不正确")
    @Schema(description = "角色类型（1-系统角色，2-业务角色）", example = "1")
    private Integer roleType;

    @NotNull(message = "租户ID不能为空")
    @Min(value = 1, message = "租户ID必须大于0")
    @Schema(description = "租户ID", example = "1")
    private Long tenantId;

    @Schema(description = "创建时间开始", example = "2024-01-01")
    private String createTimeStart;

    @Schema(description = "创建时间结束", example = "2024-12-31")
    private String createTimeEnd;

    @Min(value = 1, message = "页码必须大于0")
    @Schema(description = "页码", example = "1")
    private Integer pageNum = 1;

    @Min(value = 1, message = "每页大小必须大于0")
    @Max(value = 100, message = "每页大小不能超过100")
    @Schema(description = "每页大小", example = "10")
    private Integer pageSize = 10;
}